package com.shaohai.live.entity;

import org.json.JSONException;
import org.json.JSONObject;

import java.util.HashMap;
import java.util.Map;

public class ApiPostTaskParams {
    public String url;
    public Map<String, Object> params = new HashMap<>();

    public String getJsonString() {
        if (params == null || params.isEmpty()) {
            return "{m:1}";
        }
        try {
            JSONObject json = new JSONObject(params);
            return json.toString(0);
        } catch (JSONException e) {
            return "{m:1}";
        }
    }
}
